<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<title>合格证管理-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
<style type="text/css"> 
body{font-size:12px;}
.selectItemcont{padding:8px;}
#selectItem{background:#FFF;position:absolute;top:0px;left:center;border:1px solid #000;overflow:hidden;width:240px;z-index:1000;}
#selectItem2{background:#FFF;position:absolute;top:0px;left:center;border:1px solid #000;overflow:hidden;width:240px;z-index:1000;}
.selectItemtit{line-height:20px;height:20px;margin:1px;padding-left:12px;}
.bgc_ccc{background:#E88E22;}
.selectItemleft{float:left;margin:0px;padding:0px;font-size:12px;font-weight:bold;color:#fff;}
.selectItemright{float:right;cursor:pointer;color:#fff;}
.selectItemcls{clear:both;font-size:0px;height:0px;overflow:hidden;}
.selectItemhidden{display:none;}
</style> 		
		<script type="text/javascript">
		function jumpPage(page) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/index.do?currentPage=" + page;
			searchForm.submit();
		}
		
		function editData(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/edit.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		
		// 释放
		function release(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/release.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		//确认收证
		function receive(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/preReceive.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		
		function viewRelease(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/release/view.do?currentPage=${currentPage}&entity.id="+id;
			alert(searchForm.action );
			searchForm.submit();
		}
		function add(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/add.do?currentPage=${currentPage}";
			searchForm.submit();
		}
		function openImportSearchMove(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/openImportSearchMove.do?currentPage=${currentPage}";
			searchForm.submit();
		}
		function toImport(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/toImport.do?currentPage=${currentPage}";
			searchForm.submit();
		}
		function detail(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/detail.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		function Deletea(id){
			if(confirm("是否删除")){
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/delete.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();
			}
			
		}
		
		function deleteInStock(id){
			if(confirm("是否删除在库合格证？")){
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/deleteInStock.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();
			}
			
		}		
		function ReturnTo(id,addrss,theAddress){
			if(confirm("确认从: "+theAddress+" 回到: "+addrss)){
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/returnTo.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();
			}
			
		}
		function verify(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/verify.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		function update(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/toUpdate.do?currentPage=${currentPage}&cer.id="+id;
			searchForm.submit();
		}
		
		function exportcf(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/export.do?currentPage=${currentPage}";
			searchForm.submit();
		}
		
		function submit_query(){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/index.do";
			searchForm.submit();
		}
		function recordReturn(id){//释放回库
			if(!$("#returnRemarkField").val()){
				alert("回库理由为空，请填写回库理由。");
				$("#returnRemarkField").focus();
				return;
			}
			if(confirm("确认将改证重新入库！")){
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/recordReturn.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();
			}
		}
		
		
		//合格证详情
		function cfView(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/cfView.do?currentPage=${currentPage}&id="+id;
			searchForm.submit();
		}
		function checkdate(start,end){   
		 //得到日期值并转化成日期格式，replace(/\-/g, "\/")是根据验证表达式把日期转化成长日期格式，这样
		 //再进行判断就好判断了
			var sDate = new Date(start.value.replace(/\-/g, "\/"));
		    var eDate = new Date(end.value.replace(/\-/g, "\/"));
		    if(sDate > eDate){
		    	alert("结束日期不能小于开始日期");
		    	end.value="";
		    	end.focus();
		    	return false;
		    }
		    return true;
		 }
		
		var entityId;
		function popDiv(event, eid){
			var targetId = $('#selectItem');
			entityId = eid;
			
		    var   x   =   event.offsetLeft,   y   =   event.offsetTop;  
		    while(event = event.offsetParent){
		       x   +=   event.offsetLeft;  
		       y   +=   event.offsetTop;
		    }
			var A_top = y - 20;   //  1$(event).outerHeight(true);
			var A_left =  x - 250;
			
			targetId.bgiframe();
			targetId.show().css({"position":"absolute","top":A_top + "px" ,"left": A_left + "px"});
			
			
			targetId.find("#selectItemClose").click(function(){
				targetId.hide();
			});

			
			//$(document).click(function(event){
				//if(event.target.id !=_seft.selector.substring(1)){
				//	targetId.hide();	
				//}
			//});

			targetId.click(function(e){
				e.stopPropagation(); //  2
			});
		}
		
		function  getAbsPoint(e) {  
		    var   x   =   e.offsetLeft,   y   =   e.offsetTop;  
		    while(e=e.offsetParent)
		    {
		       x   +=   e.offsetLeft;  
		       y   +=   e.offsetTop;
		    }
		    alert("x:"+x+","+"y:"+y);  
		}
		</script>
	</head>
	<body>
	<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>合格证管理&gt;&gt;合格证
    </div>
    
    <div class="xt_main_right_center">
      <form name="searchForm" id="searchForm" method="post" action="index.do">
      <div id="selectItem" class="selectItemhidden"> 
	<div id="selectItemAd" class="selectItemtit bgc_ccc"> 
		<h2 id="selectItemTitle" class="selectItemleft">请输入回库理由</h2> 
		
		<div id="selectItemClose" class="selectItemright">关闭</div>
	</div> 
	<div id="selectItemCount" class="selectItemcont"> 
		<div id="selectSub"> 
			<textarea id="returnRemarkField" name="returnRemark" rows="3" cols="28"></textarea>
			<input type="button" value="确认回库" onclick="recordReturn(entityId)" />	
		</div> 
	</div> 
</div> 
	      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;金融机构:&nbsp; </td>
	        	<td>
	        	<select  class="input" name="search.financial.id" id="select2">
		        <option  value="">****请选择****</option>
		         <s:iterator value="fiList" status="i" id="b">
		          <option <s:if test='search.financial.id==#b.id'>selected="selected"</s:if>  value="${b.id }">${b.name }</option>
		          </s:iterator>
		      </select>
	            </td>
	            <td  class="left-td-width-bg">&nbsp;车架号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.chassis'  class="input"  value="<s:property value="search.chassis"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">&nbsp;入库时间:&nbsp;</td>
	            <td>
	            	<input name="search.warehouseDateBegin" id="warehouseDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.warehouseDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('warehouseDateEnd'))"/>
	            	至 <input name="search.warehouseDateEnd" id="warehouseDateEnd" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.warehouseDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('warehouseDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;渠道:&nbsp; </td>
	        	<td>
	        	<select  class="input" name="search.brand.id" id="select2">
		       		<option  value="">****请选择****</option>
			         <s:iterator value="brandList" status="i" id="b">
			          <option <s:if test='search.brand.id==#b.id'>selected="selected"</s:if>  value="${b.id }">${b.name }</option>
			          </s:iterator>
		      </select>
	            </td>
	            <td class="left-td-width-bg">&nbsp;店名:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.shop.shopName' class="input"  value="<s:property value="search.shop.shopName"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">出门日:&nbsp;</td>
	            <td>
	            	<input name="search.goingOutDateBegin" id="goingOutDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('goingOutDateEnd'))"/>
	            	至 <input name="search.goingOutDateEnd" id="goingOutDateEnd"  class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('goingOutDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;合格证号:&nbsp; </td>
	        	<td>
	           		<input type="text" name='search.certificationNum'  class="input" value="<s:property value="search.certificationNum"/>" style='width:120px'/>
	            </td>
	           <td class="left-td-width-bg">&nbsp;店号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.shop.shopMark' class="input"  value="<s:property value="search.shop.shopMark"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">预定到店日:&nbsp;</td>
	            <td>
	            	<input name="search.scheduledDateBegin" id="scheduledDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.scheduledDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('scheduledDateEnd'))"/>
	            	至 <input name="search.scheduledDateEnd" id="scheduledDateEnd" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.scheduledDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('scheduledDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;状态:&nbsp; </td>
	            <td>
	            	<s:select name="search.state" list="@com.jysz.certificate.persistence.enums.CertificationType@values()" theme="simple" listKey="index" listValue="name" headerKey="-1" headerValue="--请选择--" value="search.state"></s:select>
	            </td>
	            <td class="left-td-width-bg">&nbsp;贷款起始日:&nbsp; </td>
	        	<td >
	           		<input name="search.draftBeginDateBegin" id="draftBeginDateBegin" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.draftBeginDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('draftBeginDateEnd'))"/>
	           		至 <input name="search.draftBeginDateEnd" id="draftBeginDateEnd" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.draftBeginDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('draftBeginDateBegin'),this)"/>
	            </td>
	            <td class="left-td-width-bg">贷款到期日:&nbsp;</td>
	            <td>
	            	<input name="search.draftEndDateBegin" id="draftEndDateBegin" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.draftEndDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('draftEndDateEnd'))"/>
	            	至 <input name="search.draftEndDateEnd" id="draftEndDateEnd" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.draftEndDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('draftEndDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;批次号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.batchNumber' class="input"  value="<s:property value="search.batchNumber"/>" style='width:120px'/>
	            </td>
	        	<td class="left-td-width-bg">&nbsp;释放时间:&nbsp; </td>
	        	<td>
	           		<input name="search.leaveDateBegin" id="leaveDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.leaveDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('leaveDateEnd'))"/>
	           		至 <input name="search.leaveDateEnd" id="leaveDateEnd" class="Wdate"  type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.leaveDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('leaveDateBegin'),this)"/>
	            </td>
	            <td class="left-td-width-bg">释放人:&nbsp;</td>
	            <td>
	            	<jysz:autocompleter cssClass="input_ajax" name="search.releaseUserName" noSelectedClear="true"  classType="com.jysz.certificate.persistence.model.system.User" displayFields="realName" fieldMapping="{'releaseUserId':'id'}" >
					</jysz:autocompleter>
	           		<input type="text" style="display:none" id="releaseUserId" name="search.releaseUserId" value="<s:property value='search.releaseUserId'/>" />
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;区域经理:&nbsp; </td>
	        	<td>
	        		<jysz:autocompleter cssClass="input_ajax" name="search.areaUserName" noSelectedClear="true"  classType="com.jysz.certificate.persistence.model.system.User" displayFields="realName" fieldMapping="{'areaUserId':'id'}" >
					</jysz:autocompleter>
	           		<input type="text" style="display:none" id="areaUserId" name="search.areaUserId" value="<s:property value='search.areaUserId'/>" />
	            </td>
	            <td class="left-td-width-bg">&nbsp;驻店顾问:&nbsp; </td>
	            <td>
	            	<jysz:autocompleter cssClass="input_ajax" name="search.shopUserName" noSelectedClear="true"  classType="com.jysz.certificate.persistence.model.system.User" displayFields="realName" fieldMapping="{'shopUserId':'id'}" >
					</jysz:autocompleter>
	            	<input type="text" style="display:none" id="shopUserId" name='search.shopUserId' class="input"  value="<s:property value="search.shopUserId"/>" style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg">变更运输地:&nbsp;</td>
	            <td>
	            	<s:checkbox label="变更运输地" key="search.change" theme="simple"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;释放单号:&nbsp; </td>
	        	<td colspan="5">
	        		<input type="text" name='search.releaseNum' class="input"  value="<s:property value="search.releaseNum"/>" style='width:120px'/>
	            </td>
	        </tr>
	        <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="6" align="right" style="border-bottom:none;">
			    	<input type="reset" value="" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="button" name="submit" value=""  class="btn_query" onclick="submit_query()"/>
			    	
			    </td>
		    </tr>
	      </table>
      </form>
      </div>
      <br/>
      
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>合格证列表：</strong></font></td>
		    <td height="25" align="right">
		     <s:if test="@com.jysz.certificate.persistence.enums.PostType@Admin.equals(user.post)">
		   		 <a href="javascript:openImportSearchMove()">导入在库合格证</a>
		    </s:if>
		  	   <jysz:permission code="CM_CER_ADD"><a href="javascript:add()"><img src="${contextPath}/images/btn_bulu.png" alt="补录" /></a></jysz:permission>
		  	   &nbsp; <jysz:permission code="CM_CER_IMPORT"><a href="javascript:toImport()"><img src="${contextPath}/images/import.png" alt="导入合格证" /></a></jysz:permission>
		  	   &nbsp;<a href="javascript:exportcf()"><img src="${contextPath}/images/export.png" alt="导出"  /></a>
            </td>
		  </tr>
		</table>
      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
	  <tr> 
	    <td width="3%" class="top-td-width-bg">序号 </td>
	    <td width="5%" class="top-td-width-bg">店号</td>
	    <td width="5%" class="top-td-width-bg">店名</td>
	    <td width="4%" class="top-td-width-bg">渠道</td>
	    <td width="6%" class="top-td-width-bg">金融机构</td>
	    <td width="5%" class="top-td-width-bg">导入批次号</td>
	    <td width="6%" class="top-td-width-bg">车型</td>
	    <td width="6%" class="top-td-width-bg">合格证号</td>
	    <td width="6%" class="top-td-width-bg">车架号</td>
	    <td width="5%" class="top-td-width-bg">供货价</td>
	    <td width="5%" class="top-td-width-bg">订单号</td>
	    <td width="5%" class="top-td-width-bg">贷款品种号</td>
	    <td width="5%" class="top-td-width-bg">贷款起始日</td>
	    <td width="5%" class="top-td-width-bg">贷款到期日</td>
	    <td width="5%" class="top-td-width-bg">出门日</td>
	    <td width="5%" class="top-td-width-bg">预定到店日</td>
	    <td width="5%" class="top-td-width-bg">入库日期</td>
	    <td width="4%" class="top-td-width-bg">状态</td>
	    <td width="5%" class="top-td-width-bg">二网地址</td>
	    <td width="6%" class="top-td-width-bg">操作</td>
	  </tr>
	 <s:iterator value="page.result" status="st" id="cm">
		<tr  align="center">
	 <s:if test="change&&search.change">
	 	<td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="#st.index+1"/>
			</td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="shop.shopMark"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="shop.shopName"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="brand.name"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="financial.name"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="batchNumber"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="motorcycleType"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="certificationNum"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="chassis"/></td>
		    <td style="background-color: #F7F709" class="down-right-td-width-bg"><s:property value="formatAmount(supplyPrice)"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="orderNumber"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="draft"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:date name="draftBeginDate" format="yyyy-MM-dd"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:date name="draftEndDate" format="yyyy-MM-dd"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:date name="goingOutDate" format="yyyy-MM-dd"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:date name="scheduledDate" format="yyyy-MM-dd"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:date name="warehouseDate" format="yyyy-MM-dd"/></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:if test="theAddress!=null&&state.index==2">在库(二网)</s:if><s:elseif test="certificateRenew!=null&&state.index==2">在库(换入)</s:elseif><s:else><s:property value="state.name" /></s:else></td>
		    <td style="background-color: #F7F709" class="down-center-td-width-bg"><s:property value="theAddress"/></td>
			<td style="background-color: #F7F709" class="down-center-td-width-bg">
				<a href="javascript:cfView(<s:property value="id"/>)" title="详情"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>
				<jysz:permission code="CM_CER_EDIT">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@UNFINISHED.equals(state)">
						<a href="javascript:detail(<s:property value="id"/>)" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					</s:if>
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@FILL.equals(state)">
						<a href="javascript:detail(<s:property value="id"/>)" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_AUDIT">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@APPROVED.equals(state)">
						<a href="javascript:verify(<s:property value="id"/>)" title="补录审核"><img src="${contextPath}/images/audit.png" alt="补录审核" border="0" /></a>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_RECEIVE">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@ONORDER.equals(state)">
						<a href="javascript:receive(<s:property value="id"/>)" title="确认收证">确认收证</a>
					</s:if>
					</jysz:permission>
					<s:if test="theAddress != null">
					<jysz:permission code="CM_CER_WAYHME">
					<s:if test="!theAddress.equals('')&&state.index==2"><a title="回库" href="javascript:ReturnTo(${id },'${shop.shopName }','${theAddress }')">回库</a></s:if>
					</jysz:permission>
					</s:if>
					<jysz:permission code="CM_CER_DEL">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@UNFINISHED.equals(state)">
						<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@APPROVED.equals(state)">
						<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@FILL.equals(state)&&@com.jysz.certificate.persistence.enums.PostType@Shop.equals(user.post)">
							<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	
			    	</jysz:permission>
			    	
			    	<jysz:permission code="CM_CER_DEL_IN_STOCK">
				    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@INSTOCK.equals(state)">
				    		<a href="javascript:deleteInStock(<s:property value="id"/>)" title="删除在库合格证"><img src="${contextPath}/images/del.gif" alt="删除在库合格证" width="16" height="13" border="0" /></a>
				    	</s:if>
			    	</jysz:permission>
			    	
			    	<jysz:permission code="CM_CER_UPDATE">
				    <s:if test="@com.jysz.certificate.persistence.enums.CertificationType@INSTOCK.equals(state)">
						<s:if test="getUpdateCertificate(id)">
							<a href="javascript:update(<s:property value='id'/>)" title="修改"><img src="${contextPath}/images/update.png" alt="修改" width="19" height="19" border="0" /></a> 
						</s:if>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_STOCK_DEL">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@ONORDER.equals(state)">
							<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	</jysz:permission>
			    	<jysz:permission code="CM_CER_RECORD_RETURN">
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@RELEASEED.equals(state)">
<%-- 						<a href="javascript:recordReturn(<s:property value="id"/>)" title="释放回库">回库</a> --%>
					<a href="javascript:return false;" onclick="javascript:popDiv(this,<s:property value="id"/>);"  title="释放回库">释放回库</a>
					
					
					</s:if>
			    </jysz:permission>
		  </td>
	</s:if>
	<s:else>
			<td class="down-center-td-width-bg"><s:property value="#st.index+1"/>
			</td>
		    <td class="down-center-td-width-bg"><s:property value="shop.shopMark"/></td>
		    <td class="down-center-td-width-bg"><s:property value="shop.shopName"/></td>
		    <td class="down-center-td-width-bg"><s:property value="brand.name"/></td>
		    <td class="down-center-td-width-bg"><s:property value="financial.name"/></td>
		    <td class="down-center-td-width-bg"><s:property value="batchNumber"/></td>
		    <td class="down-center-td-width-bg"><s:property value="motorcycleType"/></td>
		    <td class="down-center-td-width-bg"><s:property value="certificationNum"/></td>
		    <td class="down-center-td-width-bg"><s:property value="chassis"/></td>
		    <td class="down-right-td-width-bg"><s:property value="formatAmount(supplyPrice)"/></td>
		    <td class="down-center-td-width-bg"><s:property value="orderNumber"/></td>
		    <td class="down-center-td-width-bg"><s:property value="draft"/></td>
		    <td class="down-center-td-width-bg"><s:date name="draftBeginDate" format="yyyy-MM-dd"/></td>
		    <td class="down-center-td-width-bg"><s:date name="draftEndDate" format="yyyy-MM-dd"/></td>
		    <td class="down-center-td-width-bg"><s:date name="goingOutDate" format="yyyy-MM-dd"/></td>
		    <td class="down-center-td-width-bg"><s:date name="scheduledDate" format="yyyy-MM-dd"/></td>
		    <td class="down-center-td-width-bg"><s:date name="warehouseDate" format="yyyy-MM-dd"/></td>
		    <td class="down-center-td-width-bg"><s:if test="theAddress!=null&&state.index==2">在库(二网)</s:if><s:elseif test="certificateRenew!=null&&state.index==2">在库(换入)</s:elseif><s:else><s:property value="state.name" /></s:else></td>
		    <td class="down-center-td-width-bg"><s:property value="theAddress"/></td>
			<td class="down-center-td-width-bg">
				<a href="javascript:cfView(<s:property value="id"/>)" title="详情"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>
				<jysz:permission code="CM_CER_EDIT">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@UNFINISHED.equals(state)">
						<a href="javascript:detail(<s:property value="id"/>)" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					</s:if>
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@FILL.equals(state)">
						<a href="javascript:detail(<s:property value="id"/>)" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_AUDIT">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@APPROVED.equals(state)">
						<a href="javascript:verify(<s:property value="id"/>)" title="补录审核"><img src="${contextPath}/images/audit.png" alt="补录审核" border="0" /></a>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_RECEIVE">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@ONORDER.equals(state)">
						<a href="javascript:receive(<s:property value="id"/>)" title="确认收证">确认收证</a>
					</s:if>
					</jysz:permission>
					<s:if test="theAddress != null">
					<jysz:permission code="CM_CER_WAYHME">
					<s:if test="!theAddress.equals('')&&state.index==2"><a title="回库" href="javascript:ReturnTo(${id },'${shop.shopName }','${theAddress }')">回库</a></s:if>
					</jysz:permission>
					</s:if>
					<jysz:permission code="CM_CER_DEL">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@UNFINISHED.equals(state)">
						<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@APPROVED.equals(state)">
						<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@FILL.equals(state)&&@com.jysz.certificate.persistence.enums.PostType@Shop.equals(user.post)">
							<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	</jysz:permission>
			    	
			    	<jysz:permission code="CM_CER_DEL_IN_STOCK">
				    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@INSTOCK.equals(state)">
				    		<a href="javascript:deleteInStock(<s:property value="id"/>)" title="删除在库合格证"><img src="${contextPath}/images/del.gif" alt="删除在库合格证" width="16" height="13" border="0" /></a>
				    	</s:if>
			    	</jysz:permission>
			    	
			    	<jysz:permission code="CM_CER_UPDATE">
				    <s:if test="@com.jysz.certificate.persistence.enums.CertificationType@INSTOCK.equals(state)">
						<s:if test="getUpdateCertificate(id)">
							<a href="javascript:update(<s:property value='id'/>)" title="修改"><img src="${contextPath}/images/update.png" alt="修改" width="19" height="19" border="0" /></a> 
						</s:if>
					</s:if>
					</jysz:permission>
					<jysz:permission code="CM_CER_STOCK_DEL">
					<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@ONORDER.equals(state)">
							<a href="javascript:Deletea(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
			    	</s:if>
			    	</jysz:permission>
			    	<jysz:permission code="CM_CER_RECORD_RETURN">
			    	<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@RELEASEED.equals(state)">
<%-- 						<a href="javascript:recordReturn(<s:property value="id"/>)" title="释放回库">回库</a> --%>
					<a href="javascript:return false;" onclick="javascript:popDiv(this,<s:property value="id"/>);"  title="释放回库">释放回库</a>
					
					
					</s:if>
			    </jysz:permission>
		  </td>
	</s:else>
		
		</tr>
	</s:iterator>
	<tr bgcolor="#F9FCEF"> 
	 <td height="36" colspan="20" align="center">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
	 </td>
	</tr>
	</table>

		<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
	</body>
			<script type="text/javascript" src="${contextPath}/scripts/jquery.bgiframe.js"></script>
</html>
